<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller
{
    //首页
    public function index()
    {
        $md = M('newsinfo');
        $data = $md->limit(0, 6)->select();
        $this->assign("xwlb", $data);

        $md = M('product');
        $data = $md->select();
        $this->assign("cplb", $data);


        $this->display("sy");
    }
//新闻详情
    public function xwxq()
    {
        $md = M('newsinfo');
        $nid = $_GET["nid"];
        $data = $md->where("nid=" . $nid)->find();
        $this->assign("ll", $data);
        $this->display("xwxq");
    }
//关于我们
    public function gywm()
    {
        $md = M('product');
        $data = $md->select();
        $this->assign("gywm", $data);

        $this->display(gywm);
    }
//新闻
    public function xw()
    {
        $md = M('newsinfo');//
        $data = $md->limit(0, 6)->select();
        $this->assign("xw", $data);

        $this->display("xw");
    }
//产品列表
    public function cplb()
    {
        $md = M('product');
        $data = $md->select();
        $this->assign("cp", $data);

        $this->display("cplb");
    }
//产品详情
    public function cpxq(){
        $md = M('product');
        $nid = $_GET["pid"];
        $data = $md->where("pid=".$nid)->find();
        $this->assign("cp", $data);
        $this->display("cpxq");
    }
//产品详情
    public function cpxp(){
        $md = M('product');
        $nid = $_GET["pid"];
        $data = $md->where("pid=".$nid)->find();
        $this->assign("cplb", $data);
        $this->display("cpxq");
    }

    public function wxlb()
    {
        $md = M('pweixiu');//
        $data = $md->limit(0, 6)->select();
        $this->assign("wx", $data);

        $this->display("wxlb");
    }

    public function wxxq()
    {
        $md = M('pweixiu');
        $nid = $_GET["nid"];
        $data = $md->where("cpid=".$nid)->find();
        $this->assign("wx", $data);
        $this->display("wxxq");

    }

    public function azlb()
    {
        $md = M('azcase');//
        $data = $md->limit(0, 6)->select();
        $this->assign("az", $data);

        $this->display("azlb");
    }

    public function azxq()
    {
        $md = M('azcase');
        $nid = $_GET["nid"];
        $data = $md->where("aid=".$nid)->find();
        $this->assign("az", $data);
        $this->display("azxq");

    }

}